import { configAddStatus } from "../Type";
// 全局配置
const config = {
    status: [
        { label: "centos6", value: "centos6" },
        { label: "windows", value: "windows" }
    ],
    postcode_status: [
        { label: "开启", value: true },
        { label: "关闭", value: false }
    ],
    acs_type: [
        { label: "ECS", value: "acs_ecs" },
        { label: "RDS", value: "acs_rds" }
    ],
    payment_status: [
        { label: "未支付", value: "Unpaid" },
        { label: "已支付", value: "Paid" },
        { label: "已作废", value: "Cancelled" }
    ],
    zone_id: [
        { label: "张家口", value: "zhangjiakou" },
        { label: "杭州", value: "hangzhou" }
    ],
    order_type: [
        { label: "新购", value: "New" },
        { label: "续费", value: "Renew" },
        { label: "升级", value: "Upgrade" },
        { label: "退款", value: "Refund" },
        { label: "付费类型转换", value: "Convert" },
        { label: "降配", value: "Downgrade" },
        { label: "磁盘扩容", value: "ResizeDisk" }
    ]
}

// config Reducer
const configReducer = function(state = config, action) {

    switch(action.type){
        case configAddStatus: {
            return {
                ...state,
                status: [...state.status, action.payload],
            }
        }

        default:
            return state;
    }
}

export default configReducer;